﻿using Shop.Collect;
using Shop.RemoteModel;
using Shop.RemoteModel.ActivityDiscount.Model;
using Shop.Service.Interface;

namespace Shop.Service.lmpl
{
    internal class ActivityDiscountService : IActivityDiscountService
    {
        private readonly IActivityDiscountCollect _Service;
        private readonly IActivityCollect _Activity;
        public ActivityDiscountService (IActivityDiscountCollect service, IActivityCollect activity)
        {
            this._Activity = activity;
            this._Service = service;
        }

        public DiscountSet Get (long activityId)
        {
            return this._Service.Get(activityId);
        }
        public void Sync (long activityId, DiscountSet discount)
        {
            this._Activity.CheckStatus(activityId, ActivityStatus.起草);
            this._Service.Sync(activityId, discount);
        }
    }
}
